home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / msdos / mam1_09.zip / MAM.DOC next >
Text File  |  1993-08-10  |  86KB  |  1,819 lines

  1.  
  2.                       MEMORY ALLOCATION MANAGER V1.09
  3.  
  4.  
  5.  
  6.   Memory Allocation Manager (MAM) is a small DOS utility with power.
  7.   MAM provides the functionally of Quarterdecks Manifest (MFT) program
  8.   with additional features like that found in the MARK and RELEASE
  9.   programs.  Specifically designed to be small but thorough it provides at a
  10.   glance all the information required about the PC's current memory use and
  11.   hardware state.  MAM is invaluable in identifying potential memory or system
  12.   conflicts.  Features include:
  13.  
  14.  
  15.      o    Complete and flexible DOS memory usage display, choose
  16.           between many different memory displays including:
  17.  
  18.                - Quick display of currently loaded programs, hooked
  19.                interrupt vectors and free base, upper (UMB), EMS and
  20.                XMS memory.
  21.  
  22.                - Complete display of all memory in the PC from address
  23.                0 to end of extended memory including system memory,
  24.                device drivers, video areas, installed ROMs, EMS page
  25.                frames, system BIOS, HMA area and XMS handles.
  26.  
  27.                - Display of just base (below 640Kb) memory or just
  28.                upper memory.
  29.  
  30.                - Display of loaded programs including either full path
  31.                name or program arguments.
  32.  
  33.      o    Mark memory position and restore later (similar to the popular
  34.           MARK and RELEASE programs).  Memory marks are written to
  35.           a file and occupy no memory space.  Marks need only be made
  36.           once and used multiple times.  All memory areas are restored
  37.           including base, upper (UMB), HMA, XMS and EMS memory.
  38.  
  39.      o    Store CMOS settings on disk and use later to restore CMOS or
  40.           just to compare to current settings.
  41.  
  42.      o    Quick test and display of hardware status including serial/parallel
  43.           ports and maths co-processor.  MAM identifies the UART type
  44.           and comms settings of each serial port.
  45.  
  46.      o    Invaluable as a trouble-shooter, MAM can identify problems such
  47.           as viruses, memory conflicts, interrupt clashes, faulty ports or
  48.           maths co-processors.
  49.  
  50.      o    Works on any CPU from 8088 to 80486 and any DOS version
  51.           from 2.1 upwards.  Extensively tested with most popular software
  52.           including DOS 6, DR-DOS, QEMM, 386MAX, NETROOM,
  53.           NOVELL Netware, OS/2 1.x and 2.0, Windows 3.x, 4DOS, etc.
  54.  
  55.  
  56.  
  57.      LICENSES
  58.  
  59.      MAM is share-ware.  All rights are reserved.  You are free to copy or
  60.      distribute the program but not to sell it.  If you are a personal user you
  61.      may use the program for a free 30-day trial period, afterwards you are
  62.      required to register it or delete all your copies of the program.
  63.      Governmental, institutional or commercial users must register (site
  64.      licenses are available).  MAM may not be distributed together with any
  65.      other commercial software or product or without this documentation file
  66.      without the specific permission of the author.
  67.  
  68.  
  69.      REGISTRATION
  70.  
  71.      Registration costs $20 (twenty US dollars) for personal users, when
  72.      used on one computer only.  Site licenses are $100 (one hundred US
  73.      dollars) and allow the unlimited copy and use of the program
  74.      throughout your company, organisation or government agency.   Note
  75.      that site licenses include only one copy of the program and
  76.      documentation.  Special licenses will be granted to schools and
  77.      universities (please contact me).
  78.  
  79.      Registered users will receive a registered copy of the program and one
  80.      free upgrade of the software when it is updated. By registering you are
  81.      helping me to keep up development with MAM in the ever changing
  82.      world of DOS memory management. In addition registered users will
  83.      receive support via CompuServe.  My CIS number is 76040,1420.   My
  84.      address for mail is Marc Mulders, c/o CCS, 160 Summit Ave, Montvale,
  85.      NJ 07645, USA but since communication via mail is slow please send
  86.      messages via Compuserve if you can.
  87.  
  88.  
  89.      WARRANTIES AND LIABILITIES
  90.  
  91.      Now for the (unfortunately necessary) legal stuff.  All warranties are
  92.      hereby disclaimed.  The author makes no warranties on the software
  93.      either express or implied.  The author is only liable to refund the
  94.      registration fee paid by you and no more.  In no event will the author
  95.      be liable for any consequential, special, incidental or indirect damages
  96.      of any kind arising out of the delivery, performance or use of the
  97.      software.  The author does not attest the software is error-free or that
  98.      the documentation is completely accurate.
  99.  
  100.  
  101.  
  102.      TRADEMARKS
  103.  
  104.      MS-DOS and Windows are trademarks of Microsoft Corporation.
  105.      IBM, IBM PC, XT, AT, PS/1, PS/2, OS/2 and IBM-DOS are
  106.      trademarks of International Business Machines Corporation.
  107.      Intel is a registered trademark of Intel Corporation.
  108.      Desqview, QEMM, QEMM-386 and QRAM are trademarks of
  109.      Quarterdeck Office Systems.
  110.      386^MAX is a trademark of Qualitas, Inc.
  111.      DR-DOS is a registered trademark of Digital Research.
  112.      Netware and Novell are registered trademarks of Novell, Inc.
  113.      CompuServe is a registered trademark of CompuServe Corporation.
  114.      4DOS is a registered trademark of JP Software Inc.
  115.      Trademarks of other companies mentioned in this documentation appear
  116.      for identification purposes only and are the property of their respective
  117.      companies.
  118.  
  119.  
  120.                                    INDEX
  121.  
  122.  
  123.  
  124.  
  125.      INTRODUCTION                                            1
  126.  
  127.      1.  DISPLAYING MEMORY                                   2
  128.  
  129.           1.1    The default display                         2
  130.           1.1.1  The status line                             3
  131.           1.1.2  Loaded programs                             3
  132.           1.1.3  Main and Upper memory availability          6
  133.           1.1.4  EMS memory display                          7
  134.           1.1.5  Extended memory display                     7
  135.           1.2    The /s display                              9
  136.           1.2.1  The memory map                             11
  137.           1.2.2  Other parts of the system display          16
  138.           1.3    Other memory displays and arguments        17
  139.           1.4    The device driver display                  18
  140.  
  141.  
  142.      2.  MARKING AND RESTORING MEMORY                       21
  143.  
  144.           2.1    Adding a comment to a MARK                 22
  145.           2.2    Creating and viewing MARK files            22
  146.           2.3    Restoring from MAM MARKs                   23
  147.           2.4    Erasing MARK files                         24
  148.           2.5    Hints and tips for MARK/RESTORE            24
  149.           2.6    Errors encounter with MARK/RESTORE         25
  150.  
  151.  
  152.      3.  SAVING, COMPARING AND RESTORING CMOS SETTINGS      26
  153.  
  154.           3.1    Saving and restoring CMOS settings         26
  155.           3.2    Comparing CMOS settings                    27
  156.           3.2.1  Using a batch file to do a CMOS compare    27
  157.  
  158.  
  159.      4.  HARDWARE DISPLAY                                   28
  160.  
  161.  
  162.      5.  MAM VERSION HISTORY                                30
  163.  
  164.  
  165.  
  166.      INTRODUCTION
  167.  
  168.  
  169.      Welcome, thanks for giving MAM a try!  MAM is a DOS utility
  170.      which will allow you to view memory allocation, diagnose memory
  171.      conflicts and remove memory resident software.  It was written to
  172.      provide me with all the diagnostic information I need in my everyday
  173.      work of supporting complex PC setups, and in particular 386 and 486
  174.      PC's with memory managers like QEMM, 386^MAX or DOS's
  175.      HIMEM and EMM386.  I could have written several programs to
  176.      provide this diagnostic information - one for memory mapping, one
  177.      for hardware summary display, one to remove resident programs, etc.
  178.      Instead MAM become several utilities in one.
  179.  
  180.      Besides DOS itself, MAM can be used under DOS sessions with
  181.      operating systems such as Windows or OS/2.  Due to the fact that
  182.      MAM doesn't rely on the presence of any proprietary memory
  183.      manager and uses no product-specific interrupts or entry points,
  184.      MAM is regularly used in a variety of PCs, running a variety of
  185.      DOS and Windows software.  This also means MAM should work
  186.      with future software products.  Furthermore MAM is updated
  187.      regularly as requirements arise.
  188.  
  189.  
  190.      Manual Conventions:  Although many memory and PC based
  191.      concepts are explained as appropriate, this manual would be longer
  192.      than a telephone directory if I attempted to give complete
  193.      explanations of it all.  Instead I will assume for the most part a basic
  194.      knowledge of DOS and the PC.  Absolute beginners should learn the
  195.      basics of the program here but for a more complete introduction to
  196.      these subjects I can best refer you to the many excellent DOS and
  197.      programmers reference books.
  198.  
  199.  
  200.      Various conventions are used throughout this manual:
  201.  
  202.           - Memory address are almost always expressed in hexadecimal
  203.           (base 16).  Hexadecimal numbers can be recognised by the
  204.           suffix "h" (except in the MAM listings where all addresses are
  205.           in hex).
  206.  
  207.           - Byte quantities are expressed in decimal, sometimes in
  208.           kilobytes or megabytes.  A kilobyte is used here to mean 1024
  209.           (not 1000) bytes and is abbreviated "Kb".  A megabyte is 1024
  210.           x 1024 = 1048576 bytes and is abbreviated "Mb".
  211.  
  212.           - The word "PC" is used loosely here to cover any 80x88/86
  213.           based CPU except in the context of a specific model of PC
  214.           such as the IBM PC.
  215.  
  216.           - The upright bar symbol "|" is thoughout the manual to
  217.           seperate items in a display line when several choices exist.
  218.           The choices are enclosed in square brackets, e.g. "[DOS |
  219.           BIOS]" indicates a display showing either "DOS" or "BIOS".
  220.  
  221.           - Various sample MAM listings occur, usually with example
  222.           command line syntax preceded with "C:\> ".
  223.  
  224.           - The manual is best understood from front-to-back; if unsure
  225.           of a term or acronym, look to see if it's defined in the pages
  226.           before.
  227.  
  228.  
  229.  
  230. 1.   DISPLAYING MEMORY
  231.  
  232.  
  233.      1.1  The default display
  234.  
  235.  
  236.      The simplest use of MAM is to display the currently loaded
  237.      programs and provide a summary of memory usage and availability.
  238.      Try MAM without command line arguments:
  239.  
  240.  
  241.      C:\> MAM
  242.  
  243.      MEMORY ALLOCATION MANAGER (c) 1990-1993 Marc Mulders  -  MAM V1.09
  244.      MS-DOS 5.00 on 80486 AT (Virtual Mode) with 640K and VGA display
  245.  
  246.      SEG  OWNER  SIZE  NAME      INTERRUPT VECTORS
  247.      ---  -----  ----  ----      -----------------
  248.      0B70 0008  14000  Config
  249.      0EDC 0EDD   4704  COMMAND   22-24 2E
  250.      1009 100A   2032  CLOCK     08 09 10 13 28
  251.      108A 108B   6736  SHARE     2F
  252.      A000 -----------  DOS Memory End [640k]  ------------------------
  253.      C800 C801   9776  GMOUSE    0C 33
  254.  
  255.      Main memory has 580,848 bytes available
  256.      Upper memory has 32,656 + 88,544 + 8,176 byte blocks available
  257.  
  258.      Enhanced Expanded Memory (EEMS V4.0) found at segment(s) :  1000 E000
  259.      40 (16K) EMS pages, 1 active handle(s), 7120K bytes free (7696K bytes total)
  260.      Handle  Size  Name
  261.      ------  ----  ----
  262.      0       576K  Reserved
  263.  
  264.      Extended Memory (XMM V3.00 [V6.03] found)
  265.         7424K bytes reported (all under XMM management)
  266.         7056K bytes reported free by XMM
  267.  
  268.  
  269.  
  270.      1.1.1  The status line
  271.  
  272.  
  273.      The first line displays the MAM version.  The second line, which is
  274.      present is all MAM displays regardless of which command line
  275.      arguments are used, gives a brief summary of the machine setup, i.e.
  276.  
  277.      -    which DOS version is loaded.  MAM displays the DOS version
  278.           number and if possible the DOS manufacturer - MAM detects
  279.           IBM-DOS (PC-DOS), MS-DOS, DR-DOS, IBM OS/2 and MS
  280.           OS/2.  If MAM is executed in a DOS window under Microsoft
  281.           WINDOWS or under Quarterdeck's Desqview, the word
  282.           "(Windows)" or "(Desqview)" is displayed.
  283.  
  284.      -    the CPU type is detected and displayed.  MAM detects  8088,
  285.           8086, NEC V20, NEC V30, 80186, 80286, 80386, 80486SX and
  286.           80486DX chips.  80386SX CPUs are not detected as I have yet
  287.           to find a reliable and quick test for them.  If MAM detects that
  288.           the CPU type found is being emulated and may not be the actual
  289.           CPU type, the word (Emulated) is added.
  290.  
  291.      -    the PC type is displayed.  MAM retrieves this from the machine
  292.           BIOS - this may be PC, XT, AT or PS/2 model number.
  293.  
  294.      -    the chip mode (real, virtual or protected) is displayed for 80286
  295.           CPUs and greater.  Many 386 memory managers such as
  296.           QEMM386 or DOS's EMM386 put the CPU into Virtual-86
  297.           mode.
  298.  
  299.      -    the amount of base memory is detected and displayed.  MAM
  300.           does not rely on BIOS settings or motherboard switches but
  301.           detects base memory directly.
  302.  
  303.      -    finally the type of video display adapter is detected and
  304.           displayed.  MAM detects monochrome display adapters (MDA),
  305.           Hercules Graphics Adapters (HGA), CGA, EGA, VGA and XGA
  306.           adapters.
  307.  
  308.  
  309.  
  310.      1.1.2  Loaded programs
  311.  
  312.      Next follows the display of DOS's memory allocation chains showing
  313.      loaded programs and TSRs (Terminate-and-Stay-Resident programs),
  314.      one program per line.  DOS maintains allocation chains to keep track
  315.      of memory usage.  One memory allocation chain is always maintained
  316.      in main memory (below the 640Kb boundary, called normal or low
  317.      memory).  MAM first displays any programs found in this chain.  In
  318.      addition program memory may exist above main memory (called upper
  319.      or high memory) in further allocation chains.   Any programs found in
  320.      upper memory are shown separated by a line denoting the DOS memory
  321.      end.  For example, in the above display the program SHARE is loaded
  322.      into low memory and the program GMOUSE is loaded into upper
  323.      memory (sometimes known as "loaded high").
  324.  
  325.      Note that upper memory is only available on some PC models, and only
  326.      if a suitable memory manager is installed.  MAM has been tested to
  327.      work with most memory managers including QRAM, QEMM386,
  328.      386MAX, NETROOM and the MS-DOS and DR-DOS versions of
  329.      EMM386.  MAM uses a heuristic method to determine the presence of
  330.      high memory chains and does not rely on any particular memory
  331.      manager to obtain its display.  If MAM finds no upper memory the line
  332.      "--- DOS Memory End ..." is not displayed.  Note also machines with
  333.      less than 640Kb base memory or machines which use the video pages
  334.      to obtain more than 640Kb base memory are correctly handled by
  335.      MAM - the DOS Memory End will be displayed lower or higher than
  336.      the conventional 640Kb.
  337.  
  338.  
  339.      The loaded program display as shown in 1.1, is sorted into columns:
  340.  
  341.      SEG
  342.  
  343.      The first column displays the segment address in hexadecimal where the
  344.      program starts in memory, e.g. in the above listing the program CLOCK
  345.      is loaded at address 1009:0000h.  Some important memory segment
  346.      address to watch are A000h (640Kb boundary) and 10000h (1Mb
  347.      boundary).  For most programs the SEG column will display the
  348.      segment address of the Memory Control Block (MCB).  The MCB is
  349.      a 16-byte area which is allocated by DOS for all programs that use
  350.      memory.  It records DOS information about that memory.  The MCB
  351.      proceeds the actual memory space allocated for the program, that begins
  352.      16 bytes later.
  353.  
  354.      If a memory area is not allocated to a program but is instead used by
  355.      the BIOS, the video display, an EMS page frame, etc. the SEG column
  356.      will report the starting segment address of the area.
  357.  
  358.  
  359.      OWNER
  360.  
  361.      As discussed above, DOS allocates a MCB to preceed each memory
  362.      area that is to be used by a program.   The MCB contains various
  363.      information fields such as the memory block size, the program name,
  364.      etc.  DOS also records a two byte "Process ID" in each MCB.  This
  365.      Process ID is what is displayed under the owner column.  The Process
  366.      ID is the starting segment address where the program's code actually
  367.      begins in memory - that is usually directly after the MCB itself, i.e. 16
  368.      bytes or one segment after the MCB address.
  369.  
  370.      Not all memory areas associated with a program are used to hold
  371.      program code:
  372.  
  373.           - DOS allocates an area of memory for each program to store it's
  374.           environment.  Program environment blocks will be discussed
  375.           later.
  376.  
  377.           - Programs often request memory directly from DOS to store
  378.           their own data.
  379.  
  380.      For those memory blocks that contain environment or program data,
  381.      DOS will usually set the Process ID to the segment address of the
  382.      program code.
  383.  
  384.      Sometimes DOS will allocate memory for its own purposes, if so, it
  385.      usually sets 0008h or 0009h as the owner (why these numbers ? - I
  386.      don't know).
  387.  
  388.      If an area of memory is free and not allocated, DOS will set the owner
  389.      field to 0000h.  MAM does not display the zero, instead leaving the
  390.      owner column blank.
  391.  
  392.  
  393.      SIZE
  394.  
  395.      The size column shows the (decimal) byte size of the loaded program.
  396.      The size includes all contiguous memory MAM has found to belong to
  397.      the program.  The minimum size will always be 16 bytes since this is
  398.      the size of the Memory Control Block (MCB) which always precedes
  399.      any allocated memory.
  400.  
  401.  
  402.  
  403.      NAME
  404.  
  405.      The name column shows any name that MAM has been able to find for
  406.      the program or memory area.  Here MAM must do some detective
  407.      work.  For example, the names of some programs which have executed
  408.      and then remained resident (TSRs) are not always available later.
  409.      Similarly memory allocated by a program subsequent to its load can be
  410.      difficult to track.  Briefly for those interested in the technicalities,
  411.      MAM assigns names to memory users chiefly based on:
  412.  
  413.      -    the program environment block (under DOS 3.x and above).
  414.  
  415.      -    the name field in the MCB (under DOS 4.x and above).
  416.  
  417.      -    the MCB's owner or parent address, if it points to a MCB for
  418.           which MAM has already found a name.
  419.  
  420.      However these places where program names are usually stored are often
  421.      trashed by software or not used at all.  Assigning a name to each entry
  422.      in the MAM listing is by necessity done heuristically and MAM is
  423.      sometimes going to get it wrong - some names which appear might be
  424.      complete nonsense.  A lot of work has gone into getting it right so your
  425.      indulgence is entreated when it occasional gets it wrong (please don't
  426.      send me letters asking why the name "gG%#JdR" or something like it
  427.      appeared in your MAM listing yesterday).
  428.  
  429.      Some names in the name column are not retrieved from actual programs
  430.      but are assigned by MAM.  They are usually shown in mixed case to
  431.      distinguish them from program names shown in upper case, e.g.
  432.      "Config" refers to memory used by config.sys.  The name column is left
  433.      blank is no name could be assigned.
  434.  
  435.  
  436.      INTERRUPT VECTORS
  437.  
  438.      The last column displays the interrupt vectors (in hexadecimal) which
  439.      MAM has determined are pointing into the memory area occupied by
  440.      the program.  The significance of these vectors varies.  An full
  441.      explanation of what an interrupt vector is and what it is used for is
  442.      beyond the scope of this documentation (nice way of saying "Oh No! -
  443.       please don't make me explain that too") - if confused just think of them
  444.      as program entry points used by both the hardware and software of your
  445.      machine.
  446.  
  447.      The PC has 256 interrupt vectors, 00h to FFh.  If an interrupt number
  448.      appears opposite a program name it means that program has "hooked"
  449.      the interrupt, i.e. if the interrupt were to be called by software (or raised
  450.      by hardware) execution, control would pass to a point somewhere in
  451.      that program.  Certain interrupts are more important that others, in
  452.      general the first 48 (30h) are the most consequential.  Some interrupt
  453.      numbers to take note of are (hex):
  454.  
  455.      08h (timer tick) - in most systems called by hardware 18.2 times a
  456.      second.  The interrupt 1Ch is used in a similar way.
  457.  
  458.      09h (keystroke) - called whenever a key is pressed.
  459.  
  460.      0Bh, 0Ch - usually used by the serial ports COM1 and COM2.
  461.  
  462.      10h (video) - called by programs to write to or in some way manipulate
  463.      the screen.
  464.  
  465.      13h (disk) - called by programs to read and write to disk.  The
  466.      interrupts 25h, 26h and 40h are sometimes also used for this.
  467.  
  468.      16h (keyboard) - called by programs to retrieve keystrokes.
  469.  
  470.      21h (DOS) - the main entry point for programs to DOS services.
  471.  
  472.      So in the MAM listing 1.1, we can tell that the program CLOCK has
  473.      something to do with the timer tick (makes sense doesn't it ?) and the
  474.      program GMOUSE handles one of the serial ports.
  475.  
  476.      Often interrupt vectors next to a program mean a lot less or nothing.
  477.      Some interrupts, like those above vector 90h are usually not used and
  478.      are liable to point just about anywhere.
  479.  
  480.      In the interrupt vector listing, successive interrupts are grouped
  481.      together with a dash (-), e.g. in the listing in 1.1 interrupts 22h,
  482.      23h and 24h are all pointing to COMMAND (the COMMAND.COM DOS shell).
  483.  
  484.  
  485.  
  486.      1.1.3  Main and Upper memory availability
  487.  
  488.      The amount of free memory in both main memory and upper memory
  489.      is given (in decimal) after the loaded program display.  Free main
  490.      memory is shown as the size of the largest available main memory
  491.      block.  Free upper memory is shown as one or more free block areas.
  492.      Upper program memory is rarely contiguous due to video display areas,
  493.      system BIOSes and EMS page frames which also occupy space between
  494.      the 640Kb and 1Mb boundary.  Upper program memory (RAM) is
  495.      therefore usually divided into one or more areas (sometimes called
  496.      regions).  Usually a program wanting to load into upper memory must
  497.      fit completely into one of the free areas.  So for the example memory
  498.      display in 1.1, a program with a maximum size of 88000 bytes may be
  499.      loaded high.
  500.  
  501.  
  502.      1.1.4  EMS memory display
  503.  
  504.      Expanded memory or EMS is the oldest form of extra-memory used by
  505.      today's PCs.  Expanded memory is essentially bank-switched memory.
  506.      This extra memory, which is usually larger that the normal address
  507.      space available in real mode (1024 Kb) is divided into small
  508.      independent blocks, called pages, each of 16Kb.  However the memory
  509.      is not directly addressable - instead a EMS page must be mapped into
  510.      the 1Mb real-mode address space before it can be accessed and mapped
  511.      out later to allow access to other pages.  The EMS manager provides
  512.      a set of services for access and control of this memory.  The area in
  513.      memory where these pages are mapped is called the page frame, usually
  514.      64Kb (4 pages) in size.  On machines which support the LIM EMS 4.0
  515.      standard, multiple page frames of almost any size may exist.  Programs
  516.      access EMS memory through the use of memory handles.
  517.  
  518.      If MAM detects EMS memory support, a brief summary is reported:
  519.  
  520.           - the type and version of EMS.
  521.  
  522.           - the starting segment address(es) of the page frame(s) are
  523.           displayed (hex).
  524.  
  525.           - the total amount of EMS pages.
  526.  
  527.           - the amount of active handles.
  528.  
  529.           - the amount of EMS memory free for use (Kb).
  530.  
  531.           - the total amount of EMS memory is shown in Kb.
  532.  
  533.           - lastly a list of all active handles is shown - the handle number,
  534.           number of 16Kb pages allocated and the name of the owner is
  535.           displayed.  The owner name is retrieved by a call to the EMS
  536.           management system, this name may be set by the program when
  537.           it requests EMS memory, if not MAM with leave the Name field
  538.           blank.
  539.  
  540.      Note that handle zero is reversed for use by the EMS management
  541.      software - this is often used by 386 memory managers to map the lower
  542.      640Kb (actually usually less, about 576Kb) for use by multitaskers such
  543.      as Desqview or Windows.
  544.  
  545.  
  546.      1.1.5  Extended memory display
  547.  
  548.      Extended memory is the term for memory above the 1Mb boundary.
  549.      This is only found on machines with more that 1Mb of total memory
  550.      which are based on the 80286 CPU or higher.  Memory above 1Mb can
  551.      not be accessed by the PC in real mode, instead a CPU switch to
  552.      protected mode is required.
  553.  
  554.      Although real mode addressing usually only allows the use of 20
  555.      address lines (A0-A19), most PC's today may be configured to provide
  556.      an additional address line (A20) to access an extra 64Kb while
  557.      remaining in real mode.  This area from the 1Mb boundary to 1088Kb
  558.      is known as the High Memory Area (HMA).
  559.  
  560.  
  561.      MAM reports on the size and availability of extended memory and the
  562.      HMA.  At least three methods exist for the access, allocation and
  563.      control of extended memory:
  564.  
  565.      -    the BIOS INT 15h functions.  The designers of the original IBM
  566.           PC/AT built access functions to extended memory into the ROM
  567.           BIOS (INT 15h) and this has been duplicated in every 80286 (or
  568.           higher) based machine since.  However only two functions are
  569.           provided, one which copies data to and from extended memory
  570.           and one which reports on the amount of extended memory
  571.           available.  A primitive method for a program to allocate extended
  572.           memory and then mark it as used (ensuring other programs don't
  573.           attempt to use it too) sprung up.  Programs call INT 15h to
  574.           discover the amount of extended memory available, then allocate
  575.           memory for themselves from the top of extended memory down.
  576.           The program then hooks INT 15h so as to intercept future calls
  577.           by other programs to which it reports memory availability
  578.           reduced by the amount it has allocated.  Future program are
  579.           thereby fooled into believing there is less (or no) extended
  580.           memory.  They in turn hook into INT 15h and so on.  This
  581.           method of memory usage is from the top down - MAM will
  582.           report usage as "(Used from top)".  If MAM is able to detect
  583.           which program (or the last program which) has allocated by this
  584.           method, the name will be displayed.
  585.  
  586.      -    the VDISK method.  VDISK.SYS is a ramdisk device driver
  587.           which was originally supplied by IBM.  It used a technique of
  588.           extended memory access and management which has since been
  589.           widely copied by other programs.  Programs which use this
  590.           method allocate extended memory from the 1MB boundary
  591.           upwards and record their usage in two places.  A table is created
  592.           at the 1MB boundary.  A further table is created in conventional
  593.           memory and the INT 19h vector is used to point to it.  Future
  594.           programs who wish to use extended memory should then inspect
  595.           both INT 19h and the 1Mb boundary and allocate memory above
  596.           that already used, recording their usage in these tables.  This
  597.           method of memory usage requires cooperation between programs
  598.           and sometimes gets tricky - often the two different VDISK tables
  599.           are not both maintained and end up reporting conflicting
  600.           extended memory usage.  MAM will check both tables and will
  601.           report only the greater memory usage as "(Used from bottom)".
  602.           Once again, if MAM is able to detect which program has
  603.           allocated by this method, the name will be displayed.
  604.  
  605.      -    the extended Memory Specification (XMS).  XMS refers to a
  606.           software interface standard set up by among others, Microsoft
  607.           and Intel, to access and control extended memory and the HMA.
  608.           This standard provides a full set of functions to query, allocate
  609.           and free extended memory and the HMA - similar services to that
  610.           provided by EMS.  MAM reports on the existence of an XMS
  611.           manager and issues calls to the interface to determine the amount
  612.           of free XMS memory, the presence and availability of the HMA
  613.           and the number and size of the active XMS handles.  A summary
  614.           of the information is shown here.  However the individual XMS
  615.           handles size and location is shown in the /s (system display, see
  616.           1.2).
  617.  
  618.      Note that often all three methods are used simulatenously, indeed this
  619.      is good programming practice.  For example if DOS 5 is loaded HIGH,
  620.      it allocates the HMA via XMS calls, but also records its use with
  621.      VDISK tables as well as the INT 15h method.  Furthermore most XMS
  622.      managers intercept the INT 15h vector and report only the extended
  623.      memory not under their control (often reporting no available extended
  624.      memory).
  625.  
  626.  
  627.  
  628.      1.2   The /s display
  629.  
  630.      Besides the default display explained in 1.1, various other command
  631.      line arguments can be used with MAM to show different memory views
  632.      or to show more of memory.
  633.  
  634.      The /s display (or "system" display) is the opposite of the default
  635.      display.  All memory from the first byte at address 0000:0000h to the
  636.      last byte of extended memory above the 1MB boundary at 10000:0000h
  637.      is displayed.  This is the most comprehensive of MAM memory
  638.      displays, detailing all memory and not only the DOS allocation chain(s).
  639.      All memory users are shown, whether it is a loaded program, DOS,
  640.      BIOS or PC system usage, video card space, memory not used at all,
  641.      etc.  MAM does an in-depth investigation to discover which program
  642.      or sub-system is using each region of memory.  It uncovers memory not
  643.      in use as well as memory used for more than one purpose.  Any clashes
  644.      in memory allocation - two or more memory users unwittingly using the
  645.      same area are also detected.  The various memory boundaries - top of
  646.      DOS main memory and end of CPU real mode addressing space are
  647.      demarcated in the display.  As with the default display any interrupt
  648.      vectors which are vectored into a memory region are display in the
  649.      right-hand column.
  650.  
  651.  
  652.      C:\> MAM/S
  653.  
  654.      MEMORY ALLOCATION MANAGER (c) 1990-1993 Marc Mulders  -  MAM V1.09
  655.      MS-DOS 5.00 on 80386 AT (Virtual Mode) with 640K and VGA display
  656.  
  657.      SEG  OWN/TOP   SIZE TYP  NAME/DIRECTORY PATH      VECTORS
  658.      ---- -------   ---- ---  -------------------      -------
  659.      0000 - 003F      1K Sys  Interrupt Vector Table   60-66 78-E9 F6
  660.      0040 - 004F     256 Sys  BIOS Data Area           F8
  661.      0050 - 006F     512 Dos  DOS Data Area            1E
  662.      0070 - 0128    2960 Sys  BIOS Interface (IO.SYS)  01 03 04 0F 1B 29
  663.      0129 - 026B    5168 Dos  DOS Kernel (MSDOS.SYS)   00 20 27 2A-2D 32-3F
  664.      026C   0008   15616 ***  Config                   02 0A-0E 4B 67 70
  665.                                                        72-74 76
  666.           @ 026E    1184 Drv  HIMEM
  667.           @ 02B9    8400 Drv  EMM386                   4B 67
  668.           @ 04C7    2672 Dos  45 Files
  669.           @ 056F     256 Dos  4 Fcbs
  670.           @ 0580     512 Dos  0 Buffers
  671.           @ 05A1     624 Dos  Drive List
  672.           @ 05C9    1856 Dos  Stacks=9,128             02 0A-0E 70 72-74 76
  673.      063D   0008      64 ***  DOS Data
  674.      0642   0643    2368 Psp  COMMAND (Active Shell)   22-24 2E
  675.      06D7             64 ***  Free
  676.      06DC   0643     704 Env  Active Environment
  677.      0709            320 Env  Free
  678.      071E   071F    7632 Psp  SHARE    /L:100          2F EE F1 F3 FA FD
  679.           @ 08C0     950 Dos  16 Fcbs
  680.      08FC         618528 Psp  Free                     30 EC EF F5 F7 F9
  681.      1000 - 9FFF    576K      EMS frame - 36 page(s)
  682.      9682 - 9FFE   38864 Dos  Command (Transient part)
  683.      9FFF   0008      16 ***  DOS Data
  684.      A000 -------------  End  DOS Memory End [640k]  ------------------------
  685.     A000 - AFFF     64K      VGA graphics buffer      F4 FB
  686.      B000 - B7FF     32K      --- Unused ---
  687.      B800 - BFFF     32K RAM  VGA color text buffer
  688.      C000 - C7FF     32K ROM  VGA BIOS                 1F 43
  689.      C800   C801      16 ***  UMB
  690.      C801   0008     464 ***  DOS Data
  691.           @ C803     448 Drv  SETVER
  692.      C81F            176 Env  Free
  693.      C82B   C82C   26976 Psp  SMARTDRV 3072            08 10 13 15 19 21
  694.                                                        25 26 28
  695.           @ CA29         Drv  A: - F:
  696.      CEC2   CECE     160 Env  PCMCALC
  697.      CECD   CECE    3888 Psp  PCMCALC                  09
  698.      CFC1          66528 ***  Free
  699.      E000 - EFFF     64K      EMS frame - 4 page(s)
  700.      F000 - FFFF     64K ROM  System BIOS              05-07 11 12 14 16-18
  701.                                                        1A 1C 1D 31 40-42
  702.                                                        44-4A 4C-5F 68-6F
  703.                                                        71 75 77 EB
  704.                                                        ED F0 F2 FC
  705.      10000-10FFF     64K HMA  Used (by DOS, 6K free)   FE FF
  706.           @109BD   16492 Dos  31 Buffers
  707.      10000 ------------  End  Real Mode Adr End [1088k]  ----------------------
  708.      11000-83FFF   7360K RAM  Used (from top)
  709.      11000-71CFF   6196K EMB  Handle A716h (unlocked)
  710.      71D00-83EFF   1160K EMB  Handle A71Ch (unlocked)
  711.  
  712.      Expanded Memory (EMS V4.0) found at segment(s) :  1000 E000
  713.      EMS supports Alternative Map Register sets:  16 Total, 16 Available
  714.      40 (16K) EMS pages, 1 active handle(s), 6000K bytes free (6576K bytes total)
  715.      Handle  Size  Name
  716.      ------  ----  ----
  717.      0       576K  Reserved
  718.  
  719.      Extended Memory (XMM V2.00 [V2.77] found, has 2 active handle(s))
  720.        7424K bytes found (all under XMM management)
  721.          64K bytes used (from bottom)
  722.           4K bytes reported free by XMM
  723.  
  724.  
  725.  
  726.  
  727.      1.2.1   The memory map
  728.  
  729.      Various columns not found in the default (abbreviated) memory map are
  730.      added or changed in the system display:
  731.  
  732.  
  733.      OWN/TOP
  734.  
  735.      The OWNER column is now labelled as OWN/TOP and serves three
  736.      purposes.  For MCB's the column still displays the owner segment field
  737.      retrieved from the MCB.  However since the system display shows
  738.      more than just loaded programs the column serves to show the end (or
  739.      top) segment address of memory blocks used for system or other use.
  740.      For these non-MCB blocks a memory range is displayed - the start
  741.      segment address in shown in the SEG column and separated from the
  742.      end segment address with a dash (-).  For example in the display above
  743.      the system Interrupt Vector Table occupies segment addresses 0000h to
  744.      003Fh inclusive.
  745.  
  746.      The column is put to a third use for memory uses displayed within
  747.      other memory blocks - if device drivers, DOS files or buffers, etc. are
  748.      discovered within a loaded program or memory region used principle
  749.      for something else.  In this case the SEG column is blank and the
  750.      starting segment address of the sub-user is displayed with an at-sign
  751.      (@) prefix in this column.  If the sub-user's memory area does not
  752.      begin on a segment (16-byte) boundary the closest boundary, rounded
  753.      down, is reported here.
  754.  
  755.      Note that the dual use of a memory region or the presence of drivers,
  756.      etc. within other code is usually quite legitimate, and need not represent
  757.      a conflict.  (MAM shows memory conflicts with a question mark prefix
  758.      in the NAME column).  As an example of what is quite probably valid
  759.      use, in the display shown above, 16 Fcbs (DOS File Control Blocks)
  760.      were found in the memory space occupied by the SHARE program.
  761.  
  762.  
  763.      TYP
  764.  
  765.      This column shows for each memory region the type or kind of user.
  766.      A three letter abbreviated is used and may be one of the following:
  767.  
  768.      MCB Indicators: "Psp", "Env" and "***" - these are the only types
  769.      displayed for MCBs and correspond to memory used by a loaded
  770.      program with the DOS allocation chain(s):
  771.  
  772.           "Psp" - (Program Segment Prefix).  A program loaded by DOS
  773.           is immediately prefixed with a table, known as the PSP.  The
  774.           table is 256 bytes long and is holds address and other settings
  775.           used by DOS in the control of the program.  Among other uses,
  776.           the command line arguments with which the program was
  777.           invoked are stored in the table, any files opened by the program
  778.           are recorded here with a file "handle" and a pointer to the
  779.           program's environment block is placed here.  MAM detects
  780.           MCBs as "Psp" by scanning the first 256 bytes directly after each
  781.           MCB, if a PSP is found this becomes the block "type", i.e. the
  782.           memory holds program code.
  783.  
  784.           "Env" -  A memory area in addition to that of the program code
  785.           is allocated by DOS for each program. When DOS (actually the
  786.           shell COMMAND.COM) loads a program into memory, it first
  787.           allocates a small amount of space to hold the program's
  788.           environment.  This environment is used to hold DOS settings that
  789.           are in force just before the program executed.   These are the
  790.           settings that are displayed when the DOS command SET is used
  791.           at the command line without arguments, and typically hold the
  792.           PATH, command PROMPT and other user SET's.  Note that
  793.           although all programs receive an Environment block, most
  794.           programs don't use it - some TSRs choose to deallocate (release)
  795.           their Environment blocks if unused since it would otherwise be
  796.           wasted.  In the display above, the program SMARTDRV is an
  797.           example.  MAM marks MCB's as "Env" under two circumstances
  798.           - if it finds an environment pointer in a PSP in the memory chain
  799.           which points to that MCB's address or, heuristically, if it
  800.           determines the MCB memory's block to consist mostly of ascii
  801.           text.
  802.  
  803.           "***" - MAM marks MCBs this way if it can't determine the
  804.           memory region to start with a Program Segment Prefix or to hold
  805.           an Environment block.  This often represents areas of memory
  806.           allocated by programs themselves with a "allocate memory" DOS
  807.           call.  Another origin of these memory areas is DOS itself, the
  808.           MCB can be used to hold device drivers, memory chain
  809.           maintenance information, etc.
  810.  
  811.  
  812.      BIOS/DOS Indicators: "Sys", "Dos" and "Drv" - these type indicators
  813.      are displayed by MAM for memory used by DOS or the PC BIOS.
  814.      These areas are not MCBs and are not part of the DOS memory
  815.      allocation chain(s):
  816.  
  817.           "Sys" - displayed for all memory allocated for system use - it
  818.           may be by the BIOS or due to the architecture of the CPU.
  819.  
  820.           "Dos" - displayed for all memory directly used or allocated by
  821.           DOS or the command shell (usually COMMAND.COM).  This
  822.           incudes buffers, files, file control blocks (fcb), stacks and drive
  823.           list space.
  824.  
  825.           "Drv" - displayed for all device drivers.  This type is shown
  826.           within other memory areas, usually MCB's.  MAM scans each
  827.           memory region it displays for the presence of device drivers.  If
  828.           found they are listed with their approximate starting segment
  829.           address in the OWN/TOP column prefixed with "@".  If MAM
  830.           is able to determine the size the driver occupies this is also
  831.           displayed (if not the size column is left blank).
  832.  
  833.  
  834.  
  835.      Extended Memory Indicators: "HMA" and "EMB" - these type
  836.      indicators are used for memory above 1Mb, usually under the control
  837.      of an Extended Memory (XMS) Manager.
  838.  
  839.           "HMA" - displayed for the High Memory Area, the 64Kb area
  840.           between 1024Kb and 1088Kb.  This area can only exist on 286
  841.           or greater PC's.  The HMA is created by enabling the A20
  842.           addressing line.  A Extended Memory (XMS) Manager, if loaded
  843.           will assume control of the area.  If so, MAM will report in the
  844.           NAME column whether the XMS interface accounts the area as
  845.           used or free.  DOS versions 5 and greater can use the HMA to
  846.           load part of their system code above main memory (if a
  847.           "DOS=HIGH" statement is in CONFIG.SYS).
  848.  
  849.           "EMB" - this type indicator is used for allocated extended
  850.           memory areas under the control of the XMS Manager.  Programs
  851.           request extended memory from the XMS interface in blocks,
  852.           called Extended Memory Blocks (EMB's).  XMS returns a
  853.           "handle" to the program which it then uses to access the memory
  854.           allocated.  MAM queries XMS for the handle number and size
  855.           of each EMB allocated, the size is reported in the SIZE column
  856.           and the handle number in the NAME column.  A "segment"
  857.           address in reported in the SEG column (this is simply the
  858.           physical address divided by 16).  However it is important to note
  859.           that initially the EMB has no address - no fixed physical address
  860.           exists and programs access the EMB by using its handle.  The
  861.           use of a handle rather than an physical address allows the XMS
  862.           interface more freedom to move areas, merge free areas, etc.  If
  863.           a physical address is desired the EMB must be "Locked" in
  864.           position.  Locking is done though a call to the XMS interface at
  865.           which time an address for the EMB is returned.  MAM therefore
  866.           determines an address for each EMB by first issuing a call to
  867.           "Lock" followed by an "Unlock".  Of course this address is only
  868.           meaningful if the EMB was locked before - MAM reports this in
  869.           the NAME column as "(unlocked)" (no fixed address) or
  870.           "(locked)".
  871.  
  872.      Architecture Indictors: "ROM", "RAM", "   " and "End" - these type
  873.      indicators are used to demarcate areas of memory which do not contain
  874.      MCB's and which are not allocated by DOS, BIOS or any program.
  875.  
  876.           "ROM" - displayed if MAM detects a adapter ROM (Read Only
  877.           Memory) area or system BIOS in the memory region.  The
  878.           system BIOS is contained in a ROM area, usually at segment
  879.           F000h.  In addition, various adapter cards plugged into the PC
  880.           may map their ROMs into the memory addressing space, e.g.
  881.           most VGA cards have a ROM area which is mapped at segment
  882.           C000h.  MAM scans any ROM areas found for the presence of
  883.           RAM (Random Access Memory, or read/write memory) - if the
  884.           entire ROM area contains RAM the type is changed to "RAM"
  885.           and the word "(Shadowed)" is appended in the NAME column.
  886.  
  887.           "RAM" - displayed if MAM detects a memory region to contain
  888.           RAM.  This is also shown for BIOS's which have been
  889.           "Shadowed" (copied by the system into RAM for faster access)
  890.           or for EMS page frames which are all currently mapped.
  891.  
  892.           "   " - a blank type is shown for system memory regions which
  893.           do not contain ROM or RAM.  This type is usually shown for
  894.           the video graphics buffer and for EMS page frame areas.
  895.  
  896.           "End" - this indicator is merely a place marker in the display and
  897.           does not represent a memory block.  End indicators are used in
  898.           two places to demarcate:
  899.  
  900.                - the end of DOS main memory.  This is usually at 640Kb
  901.                but may be lower for PC's with less physical RAM or
  902.                higher when the video buffer areas are sacrificed for more
  903.                main memory.
  904.  
  905.                - the real-mode addressing boundary.  This is the
  906.                maximum address that can be accessed without changing
  907.                the CPU into protected mode (usually at 1024Kb but may
  908.                be shifted to 1088Kb if the A20 addressing line is
  909.                currently enabled, i.e. the HMA exists).
  910.  
  911.  
  912.      NAME/DIRECTORY PATH
  913.  
  914.      As in the default display this column displays the name of the program
  915.      using each memory region.  This column can be used to show the
  916.      program name and program arguments (as in the system or argument
  917.      display, see 1.3) or to display the full path (drive, directory and name)
  918.      of the program (see 1.3).
  919.  
  920.      However since the system display reports more than just program
  921.      memory use, names are attributed to all memory regions and shown in
  922.      this column.  Upper case names which appear in this column are
  923.      usually obtained directly from the program in memory it describes.
  924.      Mixed case names in this column are labels assigned by MAM.  These
  925.      labels include:
  926.  
  927.      "Free" :- The area is unused but may be allocated (through calls to
  928.      DOS, XMS, etc.).
  929.  
  930.      "--Unused--" :- The region is unused and usually cannot be allocated or
  931.      not at least without re-booting or re-mapping of system software.
  932.  
  933.      "--Rammable--" :- The region is part of a large ROM or BIOS but
  934.      MAM has determined it to be used.  Most memory managers will allow
  935.      RAM to be mapped into this area so that it may support UMBs (upper
  936.      memory blocks).
  937.  
  938.      "EMS frame - n pages" :- The area is a EMS page mapping frame (see
  939.      1.1.4).
  940.  
  941.      "Handle nnnnh ([un]locked)" :- The area is a EMB (see Extended
  942.      Memory Indicators above).
  943.  
  944.      "Used (from [bottom|top])" :- An extended memory region which MAM
  945.      has determined to be used (see 1.1.5).
  946.  
  947.      "[Used|Free] (XMM Management)" :- A extended memory region under
  948.      XMS Manager control (see 1.1.5).
  949.  
  950.      "ExtBIOSDataArea" :- The Extended BIOS Data Area (XBDA) is an
  951.      small area sometimes present at the top of DOS main memory.  It is
  952.      used by the BIOS to store system settings. An XDBA is found on most
  953.      PS/2's.
  954.  
  955.      "Fixed Disk Param Table(s)" :- A table usually at the top of DOS main
  956.      memory used to hold the parameters for the fixed disk.
  957.  
  958.      "?virus" and "????????" :- An area at the top of DOS main memory
  959.      which is not part of the DOS memory allocation chain and which MAM
  960.      cannot explain.  MAM warns in some cases that this could be a virus
  961.      since many partition and boot virus hide in a similar way.  Don't panic -
  962.       MAM's test is a very primitive one and this is by no means the definite
  963.      presence of a virus.  (On the other hand I have detected many a virus
  964.      on clients machines with MAM and this simple test).  Run a good virus
  965.      detection package before taking any action.
  966.  
  967.      "Graphics Buffer" and "Text Buffer":- These are the memory mapped
  968.      areas used to hold the video text and video graphics buffers.  Bytes
  969.      written into these buffers are translated into characters on the video
  970.      screen.  The size and address of these buffers will depended on the kind
  971.      of video adapter, e.g. CGA, VGA, etc.
  972.  
  973.      "Interrupt Vector Table" :- This is the first 1K of memory which is used
  974.      as a table to store the 256 system interrupt vectors.
  975.  
  976.      "BIOS Data Area" and "DOS Data Area" :- These are two system areas
  977.      of fixed size used to hold BIOS and DOS settings.
  978.  
  979.      "BIOS Interface" :- This is the first system file (usually IO.SYS or
  980.      IBMBIO.COM) which is loaded into memory by the system bootstrap
  981.      at startup.
  982.  
  983.      "DOS Kernel" :- This is the second of the hidden system files (usually
  984.      MSDOS.SYS or IBMDOS.COM).  It is loaded into memory by the
  985.      BIOS Interface.
  986.  
  987.      "Config" :- Memory used by DOS to hold CONFIG.SYS.
  988.  
  989.      "Dos Data" and "[Buffers|Fcbs|Files|Stacks|Drive List]" :- Areas used
  990.      by DOS for system tables, buffers, files, etc. and usually contained with
  991.      the memory area used by CONFIG.SYS.  The number of buffers, files,
  992.      fcbs, etc within the region is also reported.
  993.  
  994.      "Command" : See below.
  995.  
  996.  
  997.      Memory used by the Shell:- The shell is the program which accepts
  998.      command line input at the DOS prompt and which latches commands
  999.      or DOS programs.  This is usually COMMAND.COM but may be
  1000.      another shell program such as 4DOS.  The shell allocates many memory
  1001.      areas for it own use.
  1002.  
  1003.      Firstly memory is used to hold shell code - if MAM detects a program
  1004.      to be a shell the word (Shell) is appended to its name.  Many shells
  1005.      may be loaded on top of each other - MAM marks the shell currently
  1006.      running as (Active Shell).
  1007.  
  1008.      In addition the shell allocates space for a Root Environment (the SET
  1009.      settings at boot time) and the Active Environment (the master copy of
  1010.      the environment, copied into each program's environment block just
  1011.      before its execution).  MAM attempts to find and label these
  1012.      environment blocks.  Often the Root and Active environments occupy
  1013.      the same space - if so it is labelled the "Active Environment".  The size
  1014.      of the Active or Master environment is set with the "/e" argument to the
  1015.      "shell=" command in CONFIG.SYS.
  1016.  
  1017.      Further memory is used by the shell COMMAND.COM to hold
  1018.      transient code.  This is an area of memory at the top of DOS main
  1019.      memory (usually at 640Kb).  Although COMMAND uses this memory
  1020.      for its code it is not formally allocated - indeed it is often overwritten
  1021.      by executing programs.  COMMAND code in lower memory detects
  1022.      any corruption and re-loads the code if necessary.  MAM reports this
  1023.      transient code memory use as "Command (Transient part)".
  1024.  
  1025.  
  1026.      VECTORS
  1027.  
  1028.      As described before (the default display), the last column in the system
  1029.      display exhibits for each reported memory region, the system interrupts
  1030.      which are vectored to point into that region.  The system display shows
  1031.      the entire memory map and not just loaded programs and accordingly
  1032.      the vectors for each region are reported whether the region is a
  1033.      program, BIOS, RAM, unused or the Interrupt Vector Table itself.
  1034.      Interrupt Vectors consist of a real mode segment and offset address and
  1035.      as such can only point below the real-mode addressing boundary.  In
  1036.      MAM listings no vectors will be ever be found in the columns of
  1037.      reported memory above the real-mode addressing boundary.
  1038.  
  1039.      As mentioned before, the significance of each vector's current address
  1040.      differs from vector to vector.  Many are uninitialised and point just
  1041.      about anywhere.   Other are initialised to zero, e.g. the vectors which
  1042.      are shown in the vectors column for the Interrupt Vector Table itself are
  1043.      probably unused (contain address 0000:0000).
  1044.  
  1045.  
  1046.  
  1047.      1.2.2  Other parts of the system display
  1048.  
  1049.      Unlike the default display, summary information about main and upper
  1050.      DOS memory availability is not reported in the /s display.  However
  1051.      summaries of EMS and Extended Memory are included after the
  1052.      memory map.  These are identical to that shown with the default
  1053.      display, except:
  1054.  
  1055.           The EMS display reports on the presence of Alternative Mapping
  1056.           Registers (AMRS) and how many are used/free.  These registers
  1057.           are used by multi-tasking software to improve task-switching
  1058.           performance.
  1059.  
  1060.           If a Virtual Control Program Interface (VCPI) is found it is
  1061.           reported, along with the VCPI version number and reported
  1062.           memory availability.
  1063.  
  1064.           If a Dos Protected Mode Interface (DPMI) is found it is reported,
  1065.           along with the DPMI version number and entry point.
  1066.  
  1067.  
  1068.  
  1069.      1.3  Other memory displays and arguments
  1070.  
  1071.      Besides the default and system memory displays five other memory
  1072.      displays can be selected with the command line arguments:
  1073.  
  1074.      The /f (full path) argument directs MAM to display only and all loaded
  1075.      Memory Control Blocks (MCBs).  In the NAME column the full path
  1076.      (drive, directory, file name and extention) of each program is displayed
  1077.      if possible, i.e. the location on disk from where the program was
  1078.      executed.  MAM retrieves each programs path from its environment
  1079.      block.  However many programs release (free up) their environment
  1080.      blocks before going resident and so these programs can not be
  1081.      displayed with their full path.
  1082.  
  1083.      The /a (arguments) parameter directs MAM to display only loaded
  1084.      PSPs.  Here the NAME column is used to display the command line
  1085.      arguments (if any) with which each program was invoked.
  1086.  
  1087.      The /b (below) arguments shows only the MCBs located in DOS main
  1088.      memory (e.g. below 640Kb).
  1089.  
  1090.      The /f, /a and /b argument displays don't report on EMS/XMS.
  1091.  
  1092.      The /u (upper memory) argument displays the memory map above the
  1093.      DOS main memory end.
  1094.  
  1095.      The /n (no program) argument provides a memory display with no
  1096.      MCB's - just the system, BIOS, EMS, video buffer, etc. regions in the
  1097.      memory map are displayed.
  1098.  
  1099.      Although each of the above arguments selects a different display, two
  1100.      arguments control all output listings by MAM and are intented to be
  1101.      combined with other display arguments:
  1102.  
  1103.           - the /p (page) arguments forces a display pause and wait for a
  1104.           key press after each screen of information.  Press escape while
  1105.           paused to abort MAM.
  1106.  
  1107.           - the /q (quiet) argument suppress all screen output.  This should
  1108.           be used instead of re-directing console output to nul (using
  1109.           ">nul").
  1110.  
  1111.  
  1112.  
  1113.      1.4  The device driver display
  1114.  
  1115.      The /d argument is used to display device drivers.  These drivers are
  1116.      commonly loaded with CONFIG.SYS with a "device=" command.
  1117.      Device drivers control access to a "device" (e.g. serial port or expanded
  1118.      memory).  DOS maintains a chain of device drivers and this is used
  1119.      whenever a device is accessed.
  1120.  
  1121.      There are two basic types of device drivers - character devices and
  1122.      block devices.  Character devices are byte-oriented devices such as
  1123.      serial or printer ports, screen or keyboard, etc. - all communication with
  1124.      the device occurs on a character-by-character basis.  Each time a file is
  1125.      opened, DOS firsts scans the device driver chain.  If the name of a
  1126.      character device matches that of the file name requested to be opened,
  1127.      that device is opened instead of the file.  Block devices on the other
  1128.      hand, process blocks of data at a time (e.g. disk or tape drives).  The
  1129.      devices they control are assigned drive letters and become one of the
  1130.      system's logical drives (e.g. C:, D:, etc).
  1131.  
  1132.      MAM's /d argument, when used without the above memory display
  1133.      arguments produces a display of the device driver chain.
  1134.  
  1135.  
  1136.      C:\> MAM/D
  1137.  
  1138.      MEMORY ALLOCATION MANAGER (c) 1990-1993 Marc Mulders  -  MAM V1.09
  1139.      MS-DOS 5.00 on 80486 AT (Virtual Mode) with 640K and VGA display
  1140.                     DEVICE DRIVERS
  1141.  
  1142.      ADDRESS   NAME      DEV  ATTR   STRT INT  TYPE
  1143.      -------   ----      ---  ----  ---- ---   ----
  1144.      0129:0048 NUL       1  0DC6  0DCC 8004 CharDev
  1145.      D011:20C2 A: - F:   6  01B2  0252 08C2 BlocDev, 32bitSec, GIOCTL, OpClRmovM
  1146.      B477:0000 CON       1  00F0  00FB 8053 CharDev, Stdin, Stdout, Int29, GIOCTL
  1147.      0330:0000 SETVERXX  1  006C  00D8 8000 CharDev
  1148.      026E:0000 EMMXXXX0  1  0051  0064 C000 CharDev, IOCTL
  1149.      0070:0023 CON       1  06F5  0700 8013 CharDev, Stdin, Stdout, Int29
  1150.      0070:0035 AUX       1  06F5  0721 8000 CharDev
  1151.      0070:0047 PRN       1  06F5  0705 A0C0 CharDev, GIOCTL, OutBusy
  1152.      0070:0059 CLOCK$    1  06F5  0739 8008 CharDev
  1153.      0070:006B           6  06F5  073E 08C2 BlocDev, 32bitSec, GIOCTL, OpClRmovM
  1154.      0070:007B COM1      1  06F5  0721 8000 CharDev
  1155.      0070:008D LPT1      1  06F5  070C A0C0 CharDev, GIOCTL
  1156.      0070:009F LPT2      1  06F5  0713 A0C0 CharDev, GIOCTL
  1157.      0070:00B8 LPT3      1  06F5  071A A0C0 CharDev, GIOCTL
  1158.      0070:00CA COM2      1  06F5  0727 8000 CharDev
  1159.      0070:00DC COM3      1  06F5  072D 8000 CharDev
  1160.      0070:00EE COM4      1  06F5  0733 8000 CharDev
  1161.  
  1162.  
  1163.      MAM scans the device driver chain from the head down and reports for
  1164.      each driver in the chain, its name, entry points and attributes:
  1165.  
  1166.  
  1167.      ADDRESS
  1168.  
  1169.      This is the address of the device driver header and is displayed in
  1170.      hexadecimal segment:offset format.
  1171.  
  1172.  
  1173.      NAME
  1174.  
  1175.      The name of the device is shown here - this is the name as set by the
  1176.      device itself and may not correspond to the file name used in
  1177.      CONFIG.SYS.  Usually only character devices have names - if a file
  1178.      is opened with this name the device driver will be accessed.  DOS
  1179.      always uses the first device in the chain with that name.  For example,
  1180.      above, if a write operation is made to the file "CON" (the console) the
  1181.      device driver at address B477h:0000h will be called, the driver at
  1182.      0070h:0023h will be ignored.   For block devices the NAME column
  1183.      displays the system logical drive letters controlled by the driver
  1184.      (e.g. the driver at address D011h:20C2h controls drives A: though F:).
  1185.  
  1186.  
  1187.      DEV
  1188.  
  1189.      This column reports the number of devices controlled by the device
  1190.      driver.  Only block device drivers may control more than one device.
  1191.  
  1192.  
  1193.      STRT
  1194.  
  1195.      This column display the first of two device driver entry points, the
  1196.      strategy routine offset.  These two entry points are used by DOS to
  1197.      invoke the device driver.  The strategy offset address is shown in
  1198.      hexadecimal and is relative to the segment address shown in the
  1199.      ADDRESS column - for the example above, the address of the strategy
  1200.      entry point for the NUL device driver is at 129h:DC6h.
  1201.  
  1202.  
  1203.      INT
  1204.  
  1205.      The second driver entry point, the interrupt routine offset is reported
  1206.      here.  Once again the offset is relative to the segment address in the
  1207.      ADDRESS column.
  1208.  
  1209.  
  1210.  
  1211.      ATTR
  1212.  
  1213.      This column display the device driver attributes - the driver
  1214.      characteristics.  First the attribute word, as found in the device driver
  1215.      header is displayed in hexadecimal.  This 16-bit word describes the
  1216.      capabilities of the driver (according to the bits which are set).  After
  1217.      this word MAM displays a decoding of the attribute bits:
  1218.  
  1219.           CharDev - the driver is a character device driver.
  1220.  
  1221.           BlocDev - the driver is a block device driver.
  1222.  
  1223.           Stdin - the (character) device is a standard input device.
  1224.  
  1225.           Stdout - the (character) device is a standard output device.
  1226.  
  1227.           Int29 - the device supports interrupt 29h, the fast console output
  1228.           interrupt.
  1229.  
  1230.           32bitSec - the (block) device driver can handle 32 bit sector
  1231.           numbers (i.e. for DOS 4+, logical disk partitions greater that
  1232.           32Mb).
  1233.  
  1234.           GIOCTL - the driver supports generic I/O control commands
  1235.           (control strings which are passed to the driver).
  1236.  
  1237.           OpClRmovM - the driver supports the OPEN/CLOSE/Removable
  1238.           media driver calls
  1239.  
  1240.           Non-FAT - the (block) device driver does not support the IBM
  1241.           block device File Allocation Table (FAT).
  1242.  
  1243.           Network - the (block) device is a network device.
  1244.  
  1245.           IOCTL - the driver supports I/O control comands.
  1246.  
  1247.           OutBusy - the (character) device can accept output continiously
  1248.           until it becomes busy.
  1249.  
  1250.  
  1251.      When MAM is invoked with the /d argument together with one of the
  1252.      memory map display arguments (i.e. /b, /u, /f, /a or /n) the device driver
  1253.      chain is not displayed.  Instead the appropriate memory map is
  1254.      displayed with device drivers added to the display and reported at their
  1255.      respective addresses.  For example "MAM /u/d" displays loaded
  1256.      programs and device drivers in upper memory.
  1257.  
  1258.  
  1259.  
  1260. 2.   MARKING AND RESTORING MEMORY
  1261.  
  1262.  
  1263.      MAM includes more than just the ability to display memory usage and
  1264.      loaded programs.  Using the MARK and RESTORE feature, users can
  1265.      remove loaded programs (TSRs), device drivers, EMS/XMS allocations,
  1266.      etc. and restore all memory and hardware status back to a previous load
  1267.      point.  Its simple:
  1268.  
  1269.           First use MAM to make a memory MARK before any programs
  1270.           or TSRs have loaded:
  1271.  
  1272.                MAM /m
  1273.  
  1274.           Later when you want to remove resident programs or memory
  1275.           used since the MARK, use MAM with RESTORE:
  1276.  
  1277.                MAM /r
  1278.  
  1279.      MAM's memory MARK take up no space in memory and can be used
  1280.      (restored to) as often as necessary.  This is because each MARK is
  1281.      written to a hidden file on the root directory of the current drive.
  1282.      Provided the memory allocation before this MARK doesn't change the
  1283.      same MARK can be used over and over.  Many users make a memory
  1284.      MARK as the last line of their AUTOEXEC.BAT file and use this to
  1285.      restore their machines to what they were at boot-up time - this is much
  1286.      quicker than re-booting.
  1287.  
  1288.      More than one memory MARK may be made and restored to.  After the
  1289.      /m argument specify a number between 0 and 999.  For example in the
  1290.      following sequence:
  1291.  
  1292.           C:\> MAM /m1
  1293.  
  1294.           C:\> SHARE
  1295.  
  1296.           C:\> MAM /m2
  1297.  
  1298.           C:\> PRINT
  1299.  
  1300.      Here two different MARKs are made, 001 and 002.  The DOS
  1301.      programs SHARE and PRINT are executed and remain resident in
  1302.      memory.  If the following command is used, PRINT is removed
  1303.      (unloaded) from memory:
  1304.  
  1305.           C:\> MAM /r2
  1306.  
  1307.      To unload both PRINT and SHARE use:
  1308.  
  1309.           C:\> MAM /r1
  1310.  
  1311.      If no number is specified after the /m argument as in the first example,
  1312.      the MARK is made with or restored from default MARK number 000.
  1313.  
  1314.  
  1315.  
  1316.      2.1  Adding a comment to a MARK
  1317.  
  1318.      Users may optionally add a comment to each memory MARK as it is
  1319.      made.  For example in AUTOEXEC.BAT:
  1320.  
  1321.           MAM /m100 Use this to restore memory to boot settings
  1322.  
  1323.      MAM stores the comment with the MARK in the MARK file but
  1324.      otherwise ignores the comment.  MARK file comments can be viewed
  1325.      with the /l option (described later).  Note that the comment starts
  1326.      straight after the MARK number - the space is unnecessary.  To freshen
  1327.      (recreate) a MARK with the latest memory settings but keep the
  1328.      comment intact, use a semicolon ";" instead of a new comment, e.g.
  1329.  
  1330.           C:\> MAM /m100;
  1331.  
  1332.      rewrites MARK number 100 but retains the comment line (note their is
  1333.      no space before the semicolon).  Comments are especially useful for
  1334.      MARKs created to store CMOS settings (see section 3).
  1335.  
  1336.  
  1337.      2.2  Creating and viewing MARK files on disk
  1338.  
  1339.      As explained before the MARK file is written to a hidden file in the
  1340.      root directory of the current disk drive.  In fact any available disk drive
  1341.      may to used, e.g.
  1342.  
  1343.           C:\> MAM d: /m111
  1344.  
  1345.      makes a MARK number 111 on drive D:.  Similarly
  1346.  
  1347.           C:\> MAM e: /r3
  1348.  
  1349.      restores from MARK 003 on drive E:.
  1350.  
  1351.      MARKs are written to a hidden file called "SNAPxxx.MAM" where xxx is
  1352.      the MARK number.  These files are never more than about 4000 bytes in
  1353.      size. To view which MARKs are stored on a drive (together with their
  1354.      comments) the /l argument is used, e.g.
  1355.  
  1356.  
  1357.      C:\> MAM /l
  1358.  
  1359.      MEMORY ALLOCATION MANAGER (c) 1990-1993 Marc Mulders  -  MAM V1.09
  1360.      MS-DOS 5.00 on 80286 AT (Virtual Mode) with 640K and VGA display
  1361.  
  1362.      MAM memory marks available :
  1363.  
  1364.      222 At the start of AUTOEXEC.BAT                           [12:22 20May93]
  1365.      041                                            <MAM V1.4>  [14:15 16May92]
  1366.      061                                            <MAM V1.6>  [14:13 16May92]
  1367.      111 With CMOS settings for my 386-33 with AMI BIOS         [12:22 20May93]
  1368.      000                                                        [ 0:05 28Apr93]
  1369.      601 Before SHARE                               <MAM V1.8>  [ 1:44 13Mar93]
  1370.  
  1371.      Here six MAM MARK's were found on the default drive.  Note that
  1372.      MARKs made by a previous version on MAM are incompatible with
  1373.      the current version and can't be restored to (however the CMOS settings
  1374.      may be restored from these files, more on this later).  If the MARK file
  1375.      was made by a different version of MAM this is reported after the
  1376.      comment in <angle brackets>.  Above we see the MARKs 41, 61 and
  1377.      601 were made by older MAM versions.  Lastly MAM shows the date
  1378.      and time when each MARK was made in square brackets.
  1379.  
  1380.  
  1381.      2.3  Restoring from MAM MARKs
  1382.  
  1383.      The /r argument directs MAM to restore memory allocation and
  1384.      hardware status from a previous MARK file.  MAM can only remove
  1385.      loaded programs and memory users, it doesn't reload programs which
  1386.      are not loaded now but were loaded at the time of the MARK.
  1387.      Specifically the following are removed if they were loaded or allocated
  1388.      after the MARK was made:
  1389.  
  1390.           - programs loaded in main (below 640Kb) and upper memory
  1391.           (UMB's).
  1392.  
  1393.           - EMS, XMS and HMA allocations.
  1394.  
  1395.           - Virtual Control Program Interface (VCPI) allocations.
  1396.  
  1397.           - device drivers.
  1398.  
  1399.  
  1400.      Also the following are restored:
  1401.  
  1402.           - logical drive letters added or changed by device drivers loaded
  1403.           after the MARK.
  1404.  
  1405.           - open files which were owned by programs which are unloaded
  1406.           are closed.
  1407.  
  1408.           - network resident code and drive letters added by programs such
  1409.           as NOVELL NETWARE's IPX, NETX/EMSNETX, etc. are
  1410.           removed if loaded after the MARK.
  1411.  
  1412.           - interrupt vectors, IRQs and serial port UART and parallel ports
  1413.           interrupts and control lines are restored to their state at the time
  1414.           of the MARK.
  1415.  
  1416.           - serial and parallel port I/O addresses in the BIOS data area are
  1417.           restored.
  1418.  
  1419.  
  1420.      The DOS environment (DOS PATH, PROMPT and SET's) is not
  1421.      restored by the /r argument.  Instead use /v followed by the MARK
  1422.      number, e.g.
  1423.  
  1424.           MAM /v35 c:
  1425.  
  1426.      directs MAM to restore BOTH memory status and environment settings
  1427.      from MARK number 035 on drive C:
  1428.  
  1429.  
  1430.  
  1431.      2.4  Erasing MARK files
  1432.  
  1433.      MARK files may be refreshed (overwritten) by newer MARKS of the
  1434.      same number, e.g.
  1435.  
  1436.           C:\> MAM /m12
  1437.  
  1438.      overwrites any previous MARK number 012 with new (current)
  1439.      memory settings.  MAM MARK files may also be deleted when no
  1440.      longer desired with any utility capable of deleting hidden, read-only
  1441.      files.  However since this can be tricky MAM provides a option to
  1442.      erase the MARK files.  Either one or all the files on a specific drive
  1443.      can be erased, e.g.
  1444.  
  1445.           C:\> MAM /e0
  1446.  
  1447.      erases MARK file number 000 while
  1448.  
  1449.           C:\> MAM a: /e
  1450.  
  1451.      erases all MARK files found on drive A:.  The /e argument and be used
  1452.      after the /r or /v argument to restore memory and then erase the MARK
  1453.      file, e.g.
  1454.  
  1455.           C:\> MAM /v333 /e333 /q
  1456.  
  1457.      will restore memory status and environment settings from MARK file
  1458.      333 on the current drive and then erase the file.  Here the /q argument
  1459.      is used to suppress all MAM screen output.
  1460.  
  1461.  
  1462.      2.5  Hints and tips for MARK/RESTORE
  1463.  
  1464.      Although MAM has been designed to mark and release most programs
  1465.      or memory users, some precautions are advised:
  1466.  
  1467.      - MAM can't restore (reload) programs which were loaded at the time
  1468.      of the MARK but are not resident now.
  1469.  
  1470.      - Avoid using out of date MARK files - if your memory setup changes
  1471.      frequently, use batch files to remake MARKs.  MAM can not restore
  1472.      memory from a file made by another version of MAM.  Although old
  1473.      MARK files can still be used to restore CMOS settings (see section 3)
  1474.      the /r or /v arguments can't be used with these files.
  1475.  
  1476.      - Memory can be marked or restored within a DOS batch file but avoid
  1477.      both marking and restoring within the same batch file.  A lot of work
  1478.      has gone into getting MAM's mark/restore feature to work within batch
  1479.      files but  its still not ideal.  The main reason is that the batch file
  1480.      reserves some memory for itself and this cannot be released by MAM.
  1481.      This does not apply to 4DOS, a command shell (COMMAND.COM)
  1482.      replacement program.  If possible use aliases (provided by among
  1483.      others, the DOS program DOSKEY) instead of batch files.
  1484.  
  1485.      - MAM works in a DOS session under MS Windows or OS/2 but don't
  1486.      try releasing MS Windows or OS/2 itself (be serious).  Instead try the
  1487.      ultimate memory restore, type "MAM /boot".
  1488.  
  1489.      - MAM can not restore memory allocated by some specialised programs
  1490.      using the DOS Protected Mode Interface (DPMI).  MAM can restore
  1491.      memory allocated via the Virtual Control Program Interface (VCPI).
  1492.  
  1493.      - MAM can't restore environment settings of more that 2Kb.
  1494.  
  1495.  
  1496.      2.6  Errors encounter with MARK or RESTORE
  1497.  
  1498.  
  1499.      MAM performs some checks on memory MARKs before restoring from
  1500.      them.  This is to ensure that the MARK file is valid and not outdated,
  1501.      i.e. that the memory setup before the MARK was made is the same.  If
  1502.      you change your default memory setup often (i.e. change the programs
  1503.      loaded in your CONFIG.SYS and AUTOEXEC.BAT) its best to add a
  1504.      line in your AUTOEXEC.BAT to remake the MARK file at each boot.
  1505.      MAM reports the following errors if it is unable to restore from a
  1506.      MARK file:
  1507.  
  1508.      "No such MAM mark file found" - the mark file with the specify
  1509.      number doesn't exist on this drive - use /l to view available MARK
  1510.      files.
  1511.  
  1512.      "Version x.xx restore file specified - incompatible" - MAM can't restore
  1513.      from a MARK made by a older MAM version.
  1514.  
  1515.      "Can't restore to mark - CPU/mark Virtual Mode conflict" - the CPU
  1516.      was in real mode at the time of the MARK and is now in virtual mode
  1517.      (or visa-versa).
  1518.  
  1519.      "Bad MAM mark (config) used for restore - memory not restored" -
  1520.      programs loaded in CONFIG.SYS or AUTOEXEC.BAT have changed
  1521.      since the MARK was made.
  1522.  
  1523.      "Bad MAM mark (MYPSP) used for restore - memory not restored" -
  1524.      a program was loaded at the time the MARK was made in the address
  1525.      space MAM is now currently occupying.
  1526.  
  1527.      "Bad MAM mark (# MCB) used for restore - memory not restored" -
  1528.      more programs (MCBs) were loaded at the time of the MARK than are
  1529.      loaded now.  MAM can't restore (reload) programs loaded previously.
  1530.  
  1531.      "Bad MAM mark (EMS) used for restore - memory not restored" - the
  1532.      EMS memory subsystem has changed (different or no EMS manager,
  1533.      different EMS memory or handle total, etc).
  1534.  
  1535.      "Bad MAM mark (ALT_MAP_REG) used for restore - memory not
  1536.      restored" - the EMS Alternative Map Registers Set (AMRS) count total
  1537.      has changed (see above).
  1538.  
  1539.      "Can't use console re-direction if MARK option required, see /q option"
  1540.      - the /m argument was specified together with console re-direction, e.g.
  1541.      "MAM /m >nul".  This is not allowed, use "MAM/q" instead.
  1542.  
  1543.      "Mark file appears corrupt" or  "Error on file write - disk full ?" - an
  1544.      disk error occurred while MAM was reading (restoring) or writing
  1545.      (marking) to a MARK file.  Check the free space on the file disk and
  1546.      erase corrupted files (use the /e option).
  1547.  
  1548.  
  1549.  
  1550. 3.   SAVING, COMPARING AND RESTORING CMOS SETTINGS
  1551.  
  1552.      MAM's /m option does more than store the memory, interrupt and I/O
  1553.      port settings.  In addition the CMOS settings are written to the MARK
  1554.      file automatically.  MAM does not interpret the CMOS settings but
  1555.      instead dumps the entire CMOS RAM contents (usually 128 bytes) to
  1556.      the MARK file.  Later the current CMOS may be compared or restored
  1557.      from the MARK file.  (Note that the time and date CMOS settings are
  1558.      not saved or restored.)
  1559.  
  1560.  
  1561.      3.1  Saving and restoring CMOS settings
  1562.  
  1563.      To save the current CMOS settings make a MARK as before, e.g.
  1564.           C:\> MAM a: /m600
  1565.  
  1566.      This will create a MARK file number 600 on disk A: (a MARK file
  1567.      comment is often useful here).  Both the memory and CMOS state are
  1568.      written each time /m is used.  However the CMOS settings are only
  1569.      restored at specific user command and not by the /r or /v arguments.
  1570.  
  1571.      If the CMOS is later incorrectly changed or gets corrupted, all the
  1572.      settings can be restored.  To restore the CMOS from the MARK file
  1573.      use /z, e.g.
  1574.  
  1575.           C:\> MAM /z600
  1576.  
  1577.      When MAM uses a MARK file to restore CMOS settings, the rest of
  1578.      the file (i.e. the memory, serial/parallel port settings, etc.) is
  1579.      ignored. Also, although the CMOS includes the PC's date and time
  1580.      settings, these are not restored by MAM.  Furthermore MAM can restore
  1581.      the settings from any MAM MARK version file and not just from a MARK
  1582.      file made by its current version.
  1583.  
  1584.      After the CMOS settings have been restored the computer must be re-
  1585.      booted in order for them to take effect - add the /boot argument to
  1586.      allow MAM to do this automatically:
  1587.  
  1588.           C:\> MAM /z600 /boot
  1589.  
  1590.      Remember the CMOS settings include the hard disk(s) parameters - if
  1591.      your CMOS gets corrupted you may be unable to boot from your hard
  1592.      disk.  Therefore it is best to save settings on a floppy disk so that
  1593.      they can always be accessed, e.g.
  1594.  
  1595.           C:\> MAM a: /m999This has the CMOS for my 386-33
  1596.  
  1597.      MAM CMOS restore can also be used to copy CMOS settings from one
  1598.      computer to the another, provided both have the same BIOS
  1599.      manufacturer and BIOS date.  MAM's CMOS saving and restoring
  1600.      options are ignored on a PC or XT model computer which has no
  1601.      CMOS RAM.
  1602.  
  1603.  
  1604.      3.2  Comparing CMOS settings
  1605.  
  1606.      Saved CMOS settings may also be compared to current settings either
  1607.      to check if a restore is necessary, to simply determine if settings have
  1608.      changed since a MARK file was written or to compare the CMOS
  1609.      settings of two different computers.  The /c option compares the CMOS
  1610.      settings in a MARK file to the current settings (excluding time and date
  1611.      settings), e.g.
  1612.  
  1613.           C:\> MAM /c600
  1614.  
  1615.      reports either that no change exists or the offset of the first CMOS
  1616.      RAM byte that differs.  This sort of output is probably not very
  1617.      meaningful for most users but is done for a reason - the layout of
  1618.      CMOS memory differs substantially between different BIOSes.  MAM
  1619.      makes no attempt to interpret the CMOS settings so as to work with
  1620.      any BIOS.  For most machines the use of the first 64 (40h) bytes of
  1621.      CMOS RAM is the same.  This layout is pretty much standardised on
  1622.      that first used in the IBM AT and is widely documented.  However
  1623.      most modern BIOSes use 128 (80h) bytes of CMOS.  The second 64
  1624.      bytes is used without any standards and is usually undocumented,
  1625.      although some PC manuals or motherboard booklets do offer some
  1626.      detail.  A general rule of thumb for the CMOS layout which can be
  1627.      used to interpret MAM's /c option report is:
  1628.  
  1629.           - the first 9 bytes contain real-time clock date and time settings
  1630.           and are ignored by MAM.
  1631.  
  1632.           - bytes 19 to 63 (9 to 3F hex) contain floppy and hard disk type
  1633.           and size settings and memory size settings and are the most
  1634.           important.
  1635.  
  1636.           - bytes 64 to 127 (40 to 7F hex) are either unused or are used for
  1637.           additional special BIOS settings such as shadow RAM, wait
  1638.           states, boot sequences, BIOS passwords, etc.  If you have no
  1639.           documentation for your PC and need to know the layout of these
  1640.           bytes, my only advise is ... experiment.
  1641.  
  1642.  
  1643.      3.2.1  Using a batch file to do a CMOS compare
  1644.  
  1645.      MAM sets the DOS errorlevel on exit after a /c option and this can be
  1646.      tested in a batch file if necessary.  The errorlevel is 0 if no change if
  1647.      found or 9 if the current CMOS differs from that stored in the file.  The
  1648.      CMOS settings can be checked each time the PC boots by adding the
  1649.      following to your AUTOEXEC.BAT:
  1650.  
  1651.  
  1652.           MAM /c900 /q
  1653.           if errorlevel 9 echo WARNING! CMOS SETTINGS CHANGED!
  1654.           MAM /m900Last line in AUTOEXEC.BAT/q
  1655.  
  1656.  
  1657.  
  1658. 4.   HARDWARE DISPLAY
  1659.  
  1660.  
  1661.      Although MAM is primarily a memory management utility a additional
  1662.      option is provided to give a brief hardware summary display.  MAM
  1663.      checks and reports on the I/O channel bus type, interrupt request lines
  1664.      (IRQs), serial and parallel ports and maths co-processor:
  1665.  
  1666.  
  1667.      C:\> MAM /h
  1668.  
  1669.      MEMORY ALLOCATION MANAGER (c) 1990-1993 Marc Mulders  -  MAM V1.09
  1670.      MS-DOS 5.00 on 80486 AT (Virtual Mode) with 640K and VGA display
  1671.  
  1672.      HARDWARE STATUS
  1673.      ---------------
  1674.  
  1675.      I/O Channel Type: ISA
  1676.  
  1677.      IRQ 0-15 lines enabled:  0 1 2 6 8 9 13 14
  1678.  
  1679.      Serial Ports (4):
  1680.      -----------------
  1681.      COM1 @ Port: 03F8h  UART:16450   UART Ints: Disabled            [ 1200n71]
  1682.      COM2 @ Port: 02F8h  UART:16550A  UART Ints: Disabled  FIFO: OFF [38400n81]
  1683.      COM3 @ Port: 03E8h  UART:16450   UART Ints: Disabled            [ 2400e81]
  1684.      COM4 @ Port: 02E8h  UART:16550A  UART Ints: Disabled  FIFO: OFF [ 2400n82]
  1685.  
  1686.      Parallel Ports (2): 0378h 0278h     Found: LPT1 LPT2    INTS enab: <None>
  1687.  
  1688.      Maths Co-Processor: On-Chip 486 FPU
  1689.  
  1690.  
  1691.      First the I/O channel type is reported.  This is the architecture of the
  1692.      peripheral bus used for the expansion cards (e.g disk controller, serial
  1693.      port, etc.).  MAM detects and displays PC/XT bus (used in most
  1694.      8088/86 PCs), MCA (Micro-Channel Architecture, used in most IBM
  1695.      PS/2s), ISA (Industrial Standard Architecture, used in the IBM AT and
  1696.      most 286+ clones) and EISA (Enhanced Industrial Standard
  1697.      Architecture, used in some higher performance file servers, etc.).
  1698.  
  1699.      Next MAM display the enabled Interrupt Request lines (known as IRQs
  1700.      or hardware interrupts).  Most PC and XT have 8 IRQs while 80286 or
  1701.      better AT-type machines have 16 IRQ's.  These interrupt request lines
  1702.      are typically used by hardware devices such as the hardware timer, the
  1703.      keyboard, serial and parallel ports, disk controllers, etc.).  When
  1704.      enabled, the IRQs allow devices to signal hardware events to the CPU.
  1705.      MAM displays the number (in decimal) of those IRQs which are
  1706.      currently enabled.  A more complete description of the IRQ lines is
  1707.      available in most hardware technical references.
  1708.  
  1709.  
  1710.      MAM scans the BIOS for the reported serial and parallel ports installed.
  1711.      In the case of serial ports MAM reports the following:
  1712.  
  1713.           - MAM displays the number of serial ports and the I/O port
  1714.           address (in hexadecimal) for each port as reported in the BIOS
  1715.           data area.
  1716.  
  1717.           - MAM detects the presence and the type of the UART (chip)
  1718.           type for each serial port.  The serial ports used in most earlier PC
  1719.           were based on the 8250 UART but more modern machines
  1720.           usually have serial ports use the faster 16450 UART.  Recently
  1721.           the 16550AN UART has been installed in many PCs used with
  1722.           high-speed modems.  The 16550AN chip is able to handle faster
  1723.           baud rates due to it's 16 byte FIFO receive and transmit buffers.
  1724.           The UART type test done by MAM is thorough - MAM will also
  1725.           detect most defective UARTs and will display "<?????>" as the
  1726.           UART type.  If the UART is a 16550AN, MAM displays
  1727.           whether the UART's FIFO buffer is currently enabled - this is
  1728.           usually so with modern communications resident software.
  1729.  
  1730.           -  MAM reports if the UART has enabled its interrupts with
  1731.           "UARTS Ints:".  UART interrupts, if enabled allow serial port
  1732.           processing to occur on an interrupt rather than polled basis.
  1733.  
  1734.           -  The current serial port baud rate and bit settings are shown
  1735.           with square brackets in the form:
  1736.  
  1737.                [baud parity data_bits stop_bits]
  1738.  
  1739.           The parity is shown as "n" (none), "o" (odd), "e" (even), "s"
  1740.           (space) or "m" (mark).  For example above, port COM2 is
  1741.           configured at 38600 baud, no parity, 8 data bits and 1 stop bit.
  1742.  
  1743.  
  1744.      The parallel port display shows the following:
  1745.  
  1746.           -  the number of printer ports and their respective I/O port
  1747.           addresses as reported by BIOS.
  1748.  
  1749.           -  As with the serial ports, MAM does a brief check for the
  1750.           physical existence of each port, this is reported as "Found: LPTx
  1751.           ..".  In the above example, both LPT1 and LPT2 were found to
  1752.           be present.
  1753.  
  1754.           -  MAM reports the number of any printer port which has
  1755.           interrupts enabled with "INTS enab:".  Printer port interrupts
  1756.           allow printing to occur on an interrupt basis, this is important for
  1757.           some programs or operating systems (e.g. OS/2).
  1758.  
  1759.      Note that under MS Windows and OS/2 the serial and parallel ports are
  1760.      virtualized and the results of MAM's tests are unreliable - if MAM
  1761.      detects either of these operating systems the physical tests on these
  1762.      ports are skipped.
  1763.  
  1764.      Finally MAM does a test to detect the type of maths co-processor
  1765.      installed.  MAM does not rely on BIOS for the FPU (Floating Point
  1766.      Unit) detection, instead testing the FPU directly with FPU instructions.
  1767.      Furthermore MAM detects the co-processor type independently from the
  1768.      CPU type, it can detect a 80287 FPU installed with a 80386 CPU, etc.
  1769.      If MAM detects a FPU which is not physically present but is being
  1770.      emulated by software this is also reported.
  1771.  
  1772.  
  1773.  
  1774. 5.   MAM VERSION HISTORY
  1775.  
  1776.      Version 1.9    Updated for DOS 6.  Added mark/restore of VCPI memory
  1777.                     (not with EMM386 though).  Now displays DPMI entry
  1778.                     point address.  Added mark/restore of HMA allocation.
  1779.                     Added mark/restore of FPU simulators.  Fixed mark/restore
  1780.                     of some disk caches when used with device drivers such as
  1781.                     Stacker and DoubleSpace.  Separated DOS Kernel to show
  1782.                     BIOS Interface.  Fixed bug which sometimes occurred in
  1783.                     display of interrupt vectors in the F0h-FFh range.  Now
  1784.                     displays DOS's "SC" and "SD" MCBs as "DOS Data".
  1785.  
  1786.      Version 1.8    Enhanced /l display.  Added Bus architecture and serial
  1787.                     port baud, bits, etc. display to /h option.  Improved
  1788.                     detection and display of XBDA.  Moved serial/parallel port
  1789.                     and FPU tests to occur only when /h argument used - this
  1790.                     to avoid upsetting timing sensitive comms or modem
  1791.                     downloads.  Now uses DOS 5 sub-chains to determine size
  1792.                     of and to display device drivers, files, buffers, etc in
  1793.                     CONFIG.SYS.  Display DOS 5's use of HMA and free
  1794.                     space.  Improved display of EMB's in memory map and
  1795.                     fixed bug that sometimes reported 0KB size.  Fixed
  1796.                     incorrect drive letter displays for some device drivers.
  1797.                     Fixed bug causing bomb in DOS session under Windows
  1798.                     3.1.  Fixed delay while checking serial/parallel ports under
  1799.                     OS/2 2.  Fixed bugs with MARK/RESTORE in batch files
  1800.                     and also with 386MAX.  Updated MAM to check for real
  1801.                     System BIOS ROM address and size (confusion caused to
  1802.                     MAM by QEMM's Stealth technique, among others was
  1803.                     fixed).  Many small bugs fixed and small changes made to
  1804.                     some displays.
  1805.  
  1806.      Version 1.7    Now mark/restores XMM handles and memory too.
  1807.                     Supports HIMEM.SYS, QEMM XMM manager, etc.  Full
  1808.                     support for MS-DOS 5 added. Displays programs loaded
  1809.                     with DOS 5's LOADHIGH.  Works with Windows 3.0 in
  1810.                     real, standard and enhanced modes.  Works with programs
  1811.                     using DPMI or VCPI memory interfaces. Fixed bug with
  1812.                     reporting on serial ports and in particular with 16550AN
  1813.                     UART chip.  Fixed some small bugs/errors in memory
  1814.                     displays.
  1815.  
  1816.      Version 1.6    First shareware release.  Includes support for QEMM,
  1817.                     386-to-Max, QRAM, DESQview, all known EMS
  1818.                     managers, etc.
  1819.